<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <title>1-5-1_单击计数器</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <!--载入vue.js-->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>

<body>
    <div style="text-align:center;" id="Application">
        <h1>{{count}}</h1>
        <button v-on:click="clickButton">点击</button>
    </div>

    <script>
        const App = {
            data() {
                return {
                    count: 0
                }
            },
            methods: {
                clickButton() {
                    this.count = this.count + 1
                }
            }
        }
        Vue.createApp(App).mount("#Application")
    </script>
</body>

</html>